﻿
@{
    ViewBag.Title = "Enroll";
    Layout = "~/Views/Shared/CinemaLayoutPage.cshtml";
}

@section styles{

    <style>
        #main {
            width: 700px;
            margin-top: 25px;
        }

            #main input {
                width: 250px;
            }
    </style>
}
<div class="container" id="main">
    <form class="form-horizontal">
        <div class="form-group">
            <label for="userphone" class="col-sm-2 control-label">电话号码：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="userphone">
            </div>
        </div>
        <div class="form-group">
            <label for="userphone" class="col-sm-2 control-label">请输入验证码：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="authcode" value="1111">
            </div>
        </div>
        <div class="form-group">
            <label for="username" class="col-sm-2 control-label">昵称：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="username">

            </div>
        </div>
        <div class="form-group">
            <label for="pwd" class="col-sm-2 control-label">请输入密码：</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" id="userpassword">
            </div>
        </div>
        <div class="form-group">
            <label for="newpwd" class="col-sm-2 control-label">确认密码：</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" id="newpwd">

            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" class="btn btn-default" id="btnchange">确认注册</button>
            </div>
        </div>
    </form>
</div>

@section scripts{
    <script>
        $(function () {
            $("#btnchange").click(function () {

                var usermsg = {
                    userphone: $("#userphone").val(),
                    userpassword: $("#userpassword").val(),
                    username: $("#username").val(),
                    newpwd: $("#newpwd").val(),
                    authcode: $("#authcode").val(),

                }
                console.log(usermsg);
                $.ajax({
                    url: "/User/Enroll",
                    type: "POST",
                    data: usermsg,
                    success: function (data) {
                        if (data == "注册成功")
                            alert(data);
                    },
                    error: function (data) {
                        alert("erroer ");
                    },
                })
            })
        })
    </script>
    
    
    
    }
